using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace QuanLyHocPhi.Model.Mapping
{
    public class LoaiHinhDaoTaoMap : EntityTypeConfiguration<LoaiHinhDaoTao>
    {
        public LoaiHinhDaoTaoMap()
        {
            // Primary Key
            this.HasKey(t => t.MaLoaiHinh);

            // Properties
            this.Property(t => t.MaLoaiHinh)
                .IsRequired()
                .HasMaxLength(20);

            this.Property(t => t.TenLoaiHinh)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("LoaiHinhDaoTao");
            this.Property(t => t.MaLoaiHinh).HasColumnName("MaLoaiHinh");
            this.Property(t => t.TenLoaiHinh).HasColumnName("TenLoaiHinh");
        }
    }
}
